home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
if_end.arc
/
IF-END.DOC
next >
Wrap
Text File
|
1987-10-06
|
3KB
|
76 lines
IF-END
COPYRIGHT 1987 NELSON FORD ALL RIGHTS RESERVED
Individual users are hereby granted a limited license to use
and copy this program so long as such copying is not done as
part of any commerical enterprise. Any commercial use or
distribution of this code without the written permission of
the author is a violation of Federal copyright law. This
copy has been put on CompuServe by the author for distribu-
tion there.
Nelson Ford
4845 Willowbend Blvd
Houston, TX 77235-5705
713-721-6104
The purpose of this program is to check for IF - END IF
pairs. I suppose that with proper programming techinques,
such as using small, seperately compiled modules, this
utility is not necessary. However, if you ever do get the
dreaded "IF without END IF" error message during a compile,
you will find that QB is not much help in finding the actual
error. That's because figuring out which END-IF's go with
which IF's requires some assumptions.
The assumption in this program is that code is properly
indented. For an example of "proper" indentation, see the
code in this program. To sum it up, for a block-IF segment,
the IF and END IF must be indented by the same amount and the
code inbetween must be further indented, with the exception
that the IF statement can be split into several lines, each
with the same indentation. For example
IF A=B_
AND C=D_
OR E=F THEN
GOSUB Do.something
END IF
The above code is "properly" indented. Also, remember that
IF A=B_
AND C=D_
OR E=F THEN_
GOSUB Do.something
is NOT a block IF because of the line continuation character
("_") following the THEN. And of course block-IF's and non
block-IF's can be combined:
IF x=y THEN
IF l=m THEN a=b
IF m=n THEN
c=d
END IF
END IF
To use this utility, keep it in your QB subdirectory. If you
get an IF without END IF error message, save the file you are
working on, shell to DOS and run IF-END on your saved code.
Then exit back to QB and fix the errors.
------------------------------------------------------------
For a list of other QB programming tools, subroutines and
tips, write or call for a newsletter/catalog from the
Public (Software) Library
P.O.Box 35705
Houston, TX 77235-5705
713-721-5205